<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>vue2.7</title>
  <script src="../node_modules/vue/dist/vue.js"></script>
</head>
<body>
  <div id="app">
    <h1>{{message}}</h1>
    <p>{{getText}}</p>
    <input v-model="text" placeholder="please input" />
  </div>

  <script>
    const app = new Vue({
      setup() {
        const message = Vue.ref("vue2.7")
        const text = Vue.ref("")

        Vue.effect(() => {
          console.log(text.value)
        })

        const getText = Vue.computed(() => text.value.slice(0, 5) + '1...1')

        return {
          getText,
          text,
          message
        }
      }
    }).$mount('#app')
  </script>
</body>
</html>